Skip to content

Conversation

@Salehcodes
Copy link
Contributor

Description (required)
This PR fixes an issue in Explore → Map where the turn on location services dialog was shown multiple times even after the user enabled location services from system settings.

Fixes #6597

What changes did you make and why?

Root cause

ExploreFragment was registering a ViewPager.OnPageChangeListener twice:

  • once in onCreateView()
  • and again inside onCreateOptionsMenu()

onCreateOptionsMenu() can be called multiple times during the fragment lifecycle so this resulted in multiple listeners being added over time.

Each listener calls:
mapRootFragment?.requestLocationIfNeeded()

Tests performed (required)
after I ran lint and verified the project builds successfully using the BetaDebug build variant.

  1. Disabled location services on the device
  2. Opened the app and navigated to Explore → Map
  3. Tapped Settings from the dialog and enabled location services
  4. Returned to the app and verified that the dialog no longer appears repeatedly
  5. Confirmed map loads nearby media correctly after location is enabled. (here i discovered an issue that the map do not refresh automatically after enabling location in current version I will open a new issue for that).

Tested {build variant betaDebug} on {Galaxy s23 } with android 16.

Screenshots (for UI changes only)
before :

Screen_Recording_20260101_152652_Commons.mp4

after:

Screen_Recording_20260102_211854_Commons.mp4

@github-actions
Copy link

github-actions bot commented Jan 3, 2026

✅ Generated APK variants!

Copy link
Collaborator

@RitikaPahwa4444 RitikaPahwa4444 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for the delay, this works well. Thanks @Salehcodes :)

@RitikaPahwa4444 RitikaPahwa4444 merged commit 621348c into commons-app:main Jan 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Asking for permission message stays after going to phone settings

2 participants